﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace JewererBasic.BO
{
    public class UnitBO
    {
        static public int GetId(string name)
        {
            MSQDBEntities db = new MSQDBEntities();
            var query = from d in db.UNITs
                        where string.Equals(name, d.Name)
                        select d.Id;
            if (query.Count() > 0)
                return query.ToList().First();
            return -1;
        }
    }
}